<template>
  <div>
    <div class="itemMusicTop">
      <img :src="playList.coverImgUrl" alt="" class="bgImg" />
      <div class="itemLeft">
        <svg class="icon" aria-hidden="true" @click="$router.go(-1)">
          <use xlink:href="#icon-zuojiantou"></use>
        </svg>
        <span>歌单</span>
      </div>
      <div class="itemRight">
        <svg
          class="icon"
          aria-hidden="true"
          @click="$router.push('/SearchMusic')"
        >
          <use xlink:href="#icon-sousuo"></use>
        </svg>
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-caidan"></use>
        </svg>
      </div>
    </div>
    <div class="musicCentent">
      <img :src="playList.coverImgUrl" alt="" />
      <div class="cententRight">
        <div class="cententTitle">{{ playList.name }}</div>
        <div class="cententImg">
          <img :src="playList.creator.backgroundUrl" alt="" />
          <span>{{ playList.creator.nickname }}</span>
        </div>
        <div class="cententBotton">{{ playList.description }}</div>
      </div>
    </div>
    <div class="musicBotton">
      <div class="musicMessage">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-xiaoxi"></use>
        </svg>
        <span>{{ playList.commentCount }}</span>
      </div>
      <div class="musicShare">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-fenxiang"></use>
        </svg>
        <span>{{ playList.shareCount }}</span>
      </div>
      <div class="musicDoload">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-xiazai"></use>
        </svg>
        <span>下载</span>
      </div>
      <div class="musicChoose">
        <svg class="icon" aria-hidden="true">
          <use xlink:href="#icon-xuanze"></use>
        </svg>
        <span>多选</span>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  setup(props) {
    if ((props.playList.creator = "")) {
      playList.props.creator = JSON.parse(
        sessionStorage.getItem("musicDetail")
      ).playlist.creator;
    }
  },
  props: ["playList"],
};
</script>
<style lang="less" scoped>
.itemMusicTop {
  width: 100%;
  height: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  .itemLeft {
    width: 25%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0.2rem;
    span {
      font-size: 0.5rem;
      color: #fff;
    }
    .icon {
      fill: #fff;
    }
  }
  .itemRight {
    width: 25%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0.2rem;
    .icon {
      fill: #fff;
    }
  }
  .bgImg {
    width: 100%;
    height: 9rem;
    //层级
    position: absolute;
    z-index: -1;
    //虚化
    filter: blur(20px);
  }
}
.musicCentent {
  display: flex;
  justify-content: space-between;
  padding: 0 0.2rem;
  img {
    width: 2.5rem;
    height: 2.7rem;
    border-radius: 20px;
  }
  .cententTitle {
    font-size: 0.34rem;
    color: #fff;
    font-weight: 900;
    padding: 0 0.2rem;
  }
  .cententImg {
    display: flex;
    // justify-content: space-around;
    align-items: center;
    img {
      margin-left: 0.2rem;
      width: 1rem;
      height: 1rem;
      margin-top: 0.1rem;
      border-radius: 100%;
    }
    span {
      color: #fff;
      padding: 0 0.2rem;
    }
  }
  .cententBotton {
    padding: 0 0.2rem;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}
.musicBotton {
  display: flex;
  justify-content: space-around;
  width: 100%;
  height: 1rem;
  align-items: center;
  .musicMessage,
  .musicShare,
  .musicDoload,
  .musicChoose {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    .icon {
      fill: #fff;
    }
    span {
      color: #fff;
      margin-top: 0.1rem;
    }
  }
}
</style>
